package homework_02;

public class Test {
    public static void main(String[] args) {
//        System.out.println("FirstDemo");
        int a = 2;
        int b = 3;//ab值的交换
        int c = 0;//中间量
        c = a;
        a = b;
        b = c;
        System.out.println("a:" + a);
        System.out.println("b" + b);

        //位数之和
        int num = 789;
        System.out.println("给定的三位数" + num);
        int m = 0;
        int n = 0;
        int o = 0;
        m = num / 100;//取百位
        num = num % 100;//得到两位数
        n = num / 10;//取十位
        o = num % 10;//取个位
        int sum = m + n + o;
        System.out.println("位数之和：" + sum);

        //华摄氏转换
        double cel1 = 37.0;
        double geh1 = 37.0;
        double nCel = 0.0;
        double nGeh = 0.0;
        System.out.println("摄氏" + cel1);
        System.out.println("华氏" + geh1);
        nCel = (cel1 - 32) * 5 / 9;
        nGeh = geh1 * 9 / 5 + 32;
        System.out.println("转换华氏" + nCel);
        System.out.println("转换摄氏" + nGeh);

        //大小写转换
        char mem = 'A';
        System.out.println("大写：" + mem);
        char men = (char) (mem + 32);
        System.out.println("小写" + men);
    }
}
